home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / fpu881 / src6.zoo / _floatsi.s < prev    next >
Text File  |  1991-09-24  |  741b  |  38 lines

  1. # long integer to double float conversion routine
  2. #
  3. # Written by M.Ritzert
  4. # 5.10.90
  5. # ritzert@dfg.dbp.de
  6. #
  7.  
  8. # addresses of the 68881 data port. This choice is fastest when much data is
  9. # transferred between the two processors.
  10.  
  11. comm =     -6    |    fpu command reg
  12. resp =    -16    |    fpu response reg
  13. zahl =      0    |    fpu data reg
  14.  
  15. # waiting loop ...
  16. #
  17. # wait:
  18. # ww:    cmpiw    #0x8900,a1@(resp)
  19. #     beq    ww
  20. # is coded directly by
  21. #    .long    0x0c688900, 0xfff067f8
  22.  
  23.     .text
  24.     .even
  25.     .globl    __floatsidf, ___floatsidf
  26.  
  27. __floatsidf:
  28. ___floatsidf:
  29.     lea    0xfffa50,a0
  30.     movew    #0x4000,a0@(comm)    | load long int to fp0
  31.     cmpiw    #0x8900,a0@(resp)    | check
  32.     movel    a7@(4),a0@
  33.     movew    #0x7400,a0@(comm)    | get double from fp0
  34.     .long    0x0c688900, 0xfff067f8
  35.     movel    a0@,d0
  36.     movel    a0@,d1
  37.     rts
  38.